/*
 +----------------------------------------------------------------------
 + Title        : 分类接口
 + Author       : huwl
 + Version      : 1.0.0
 + Initial-Time : 2023-08-10
 + Last-time    : 这个文件最后修改的时间 + 修改人的名称
 + Desc         : 分类接口
 +----------------------------------------------------------------------
*/
import type { BannerListResult, CategoryListResult } from '@/types/home'
import { http } from '@/utils/httpRequest'


/**
 * 获取轮播图
 * @param object params-----------------------------------------请求参数
 *
 * @returns BannerListResult
 * author huwl
 */
export const reqGetBannersAPI = (params: object) => {
  return http<BannerListResult>({
    method: 'GET',
    url: 'banner/list',
    data: params
  })
}


/**
 * 获取分类列表
 * @param object params-----------------------------------------请求参数
 *
 * @returns CategoryListResult
 * author huwl
 */
export const reqGetCategoryListAPI = (params: object) => {
  return http<CategoryListResult>({
    method: 'GET',
    url: 'category/list',
    data: params
  })
}

/**
 * 获取分类树
 * @param object params-----------------------------------------请求参数
 *
 * return json
 * author huwl
 */
export const reqGetCategoryTreesAPI = (params: any) => {
  return http({
    method: 'GET',
    url: 'category/getTreeCategory',
    data: params
  })
}

/**
 * 获取品牌
 * @param object params-----------------------------------------请求参数
 *
 * return json
 * author huwl
 */
export const reqGetBrandListAPI = (params: any) => {
  return http({
    method: 'GET',
    url: 'brand/list',
    data: params
  })
}